package moe.oil.dto.feedback;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import moe.oil.dto.user.UserDTO;
import moe.oil.enumeration.FeedBackType;
import moe.oil.validation.grop.OnUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

@Data
@Accessors(chain = true)
@Validated({OnUpdate.class})

public class FeedbackDTO  {

    @NotNull(message = "Feedback id不能为空")
    private Long feedbackId;


    private String content;

    @NotNull(message = "反馈类型不能为空")
    @Valid
    private UserDTO userDTO = new UserDTO();

    @NotNull(message = "反馈状态不能为空")
    private FeedBackType status =FeedBackType.UNKNOWN;

    @NotNull(message = "反馈时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd ")
    private LocalDate createTime;

    private Long likeCount;

    private Long browseCount;

}
